package cn.com.greatwall.common.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.password.PasswordEncoder;

import cn.com.greatwall.common.utils.PwdEncoderUtil;

/**
 * @Author herw
 * @Time 2022-01-08 20:04:38
 * @Version 1.0
 * @Description: 密码加密配置类
 */
public class DefaultPasswordConfig {
    @Bean
    @ConditionalOnMissingBean
    public PasswordEncoder passwordEncoder() {
        return PwdEncoderUtil.getDelegatingPasswordEncoder("bcrypt");
    }
}

